<?php
	require_once('Connections/conexao.php'); 
	
	$pg = $_GET['pg'];

	mysql_select_db($database_conexao, $conexao);
	
	$queryNot = "SELECT * FROM noticias";
	$Not = mysql_query($queryNot, $conexao) or die(mysql_error());
	$rowNot = mysql_fetch_assoc($Not);
	$totalRowsNot = mysql_num_rows($Not);
?>


<?php do { ?>
    <div id="pc-noticia">
        <div id="pc-noticia-img"></div>
        
        <div id="pc-noticia-txt">
            <div id="pc-noticia-titulo1" class="noticia-txt"><?php echo $rowNot['comentario']; ?></div>
            <div id="pc-noticia-titulo2" class="noticia-txt"><?php echo $rowNot['titulo']; ?></div>
            <div id="pc-noticia-site" class="noticia-txt"><?php echo $rowNot['site']; ?></div>
            <div id="pc-noticia-texto" class="noticia-txt"><?php echo $rowNot['texto']; ?>...</div>
            <div id="pc-noticia-opcoes" class="noticia-txt">
                <div id="opcoes1" class="pc-opcoes"><a href="?pg=noticia&id=<?php echo $rowNot['id']; ?>">Continuar lendo</a></div>
                <?php if (isset($_SESSION["autenticado"]) == true) { ?>
                <div id="opcoes2" class="pc-opcoes"><a href="files/lib/php/noticia-add.php?idUser=<?php echo $_SESSION['id']; ?>&idNot=<?php echo $rowNot['id']; ?>&pg=<?php echo $pg; ?>">Ler mais tarde</a></div>
                <?php } else { ?>
                <div id="opcoes2" class="pc-opcoes"><a href="?pg=login">Ler mais tarde</a></div>
                <?php } ?>
                <div id="opcoes3" class="pc-opcoes"><a href="#">Falar pra todo mundo</a></div>
            </div>
        </div>
        
    </div>
<?php } while ($rowNot = mysql_fetch_assoc($Not)); ?>